﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Agresso.Interface.Layer.Domain
{
    public class i_AGRESO_SYNC
    {
        public long i_id = 0;//] [int] IDENTITY(1,1) NOT NULL,public int AS_ID = 0;//] [int] IDENTITY(1,1) NOT NULL,
        public int AS_ID = 0;//] [int] IDENTITY(1,1) NOT NULL,public int AS_ID = 0;//] [int] IDENTITY(1,1) NOT NULL,
        public int AS_IS_EXPORTED = 0;// bit NULL,
        public string AS_PICKUP_DATE_TIME = "";// varchar(16) NULL,
        public string remarks = "";
        public DateTime insert_date = new DateTime(1900, 1, 1);
        public string batch_id = "";
        public DateTime AS_ADD_DATE = new DateTime(1900, 1, 1);

        public i_AGRESO_SYNC(SqlDataReader rd)
        {
            i_id = rd["i_id"] is DBNull ? 0 : Convert.ToInt64(rd["i_id"]);
            AS_ID = rd["AS_ID"] is DBNull ? 0 : Convert.ToInt32(rd["AS_ID"]);
            AS_IS_EXPORTED = rd["AS_IS_EXPORTED"] is DBNull ? 0 : Convert.ToInt32(rd["AS_IS_EXPORTED"]);
            AS_PICKUP_DATE_TIME = rd["AS_PICKUP_DATE_TIME"] is DBNull ? "" : rd["AS_PICKUP_DATE_TIME"].ToString();
            remarks = rd["remarks"] is DBNull ? "" : rd["remarks"].ToString();
            insert_date = rd["insert_date"] is DBNull ? insert_date : Convert.ToDateTime(rd["insert_date"]);
            AS_ADD_DATE = rd["AS_ADD_DATE"] is DBNull ? AS_ADD_DATE : Convert.ToDateTime(rd["AS_ADD_DATE"]);
            batch_id = rd["batch_id"] is DBNull ? "" : rd["batch_id"].ToString();
        }
    }
}
